package com.aop.proxy;

public class ProductDAOImpl implements ProductDAO {
    @Override
    public String addOrder(String name) {
        return "下了"+name+"订单";
    }

    public static void main(String[] args) {
        // 没有实现接口的类的代理
        // 创建目标对象
        ProductDAOImpl impl = new ProductDAOImpl();
        // 创建cglib代理
        ProductDAO cglibProxy = (ProductDAO) new CGLIBProxy().createCGLIBProxy(impl);
        String result =  cglibProxy.addOrder("电器");
        System.out.println(result);
    }
}
